package vip.meeet.tool.guava.start;

import com.google.common.eventbus.AsyncEventBus;
import com.google.common.eventbus.EventBus;
import vip.meeet.tool.guava.event.ChargeEvent;
import vip.meeet.tool.guava.listener.CommonListener;

import java.util.concurrent.Executors;

public class EventBusStart {
    public static void main(String[] args) {
        EventBus eventBus = new EventBus();
        eventBus.register(new CommonListener());
        eventBus.post(new ChargeEvent());

        AsyncEventBus asyncEventBus = new AsyncEventBus(Executors.newCachedThreadPool());
        asyncEventBus.register(new CommonListener());
        asyncEventBus.post(new ChargeEvent());
        System.out.println("main");
    }
}
